#!/usr/bin/env bash

# recovery - windows recovery entries
#
# Copyright (C) 2024 Joseph P. Zeller
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

x="$1"
locale="$2"
if [[ -z "$locale" ]]; then  locale="en-US"; fi
echo "Install Language: $locale" 1>&2

### Windows Boot Manager Entry ###
printf "cd \Objects\n"
printf "cd {9dea862c-5cdd-4e70-acc1-f32b344d4795}\n"
printf "cd Elements\n"
printf "cd 11000001\n"
printf "setval 1\n"
printf "Element\n"
./scripts/update_device "/dev/disk"$x"s1"
printf "cd ..\n"
printf "cd 12000005\n"
printf "setval 1\n"
printf "Element\n"
printf "string:%s\n" "$locale"
printf "commit\n"
printf "unload\n"


